const path = require("path");
const webpack = require("webpack");
const rootPath = path.resolve(__dirname, "../");
const electronUtils = require("./electron-utils");
const baseConfig = require("./webpack.prod.config");
const compiler = webpack(baseConfig);

console.log("打包开始...");
// 执行
compiler.run((err, status) => {
    if(err){
        if(err.details){
            console.error(err.details);
        }
        return null;
    }
    if(status.hasErrors()){
        console.error(status.errors);
    }

    if(status.hasWarnings()){
        console.warn(status.waiting);
    }

    console.log(status.toString({
        color:true
    }));
    electronUtils.runElectronBuild();
});




